<?php
$roomId = $_POST['room_id'];

// 连接到数据库

require_once 'databaseConnection.php';
$dbConn = connectToDatabase();

// 执行删除房间的 SQL 查询
$sql = "DELETE FROM rooms WHERE rooms_id = :room_id";
$stmt = $dbConn->prepare($sql);
$stmt->bindParam(':room_id', $roomId);
$stmt->execute();

// 返回适当的响应
if ($stmt->rowCount() > 0) {
  echo '成功删除房间';
} else {
  echo '未找到房间';
}
?>